package org.chispa.api.falsepos;

import org.chispa.api.util.RelationalSymbol;

public class NumberFilter {
	
	private Double left;
	private Double right;
	private RelationalSymbol rel;
	
	public NumberFilter(Number left,Number right,RelationalSymbol rel)
	{
		this.left=left.doubleValue();
		this.rel=rel;
		this.right=right.doubleValue();
	}
	
	public boolean isTrue()
	{
		switch(rel){
		case LESS:
			return(left<right);
		case GREATER:
			return (left>right);
		case GRT_OR_EQ:
			return (left>=right);
		case LESS_OR_EQ:
			return (left<=right);
		case EQUALS:
			return (left==right);
		default:
			return (left!=right);
		}

	}

}
